FROM clonelin/centos8-node22-prisma:latest

ENV PATH="/root/.nvm/versions/node/v22.15.0/bin:${PATH}"

WORKDIR /app

# 安装依赖
RUN yum install -y cairo-devel libjpeg-turbo-devel pango-devel giflib librsvg2-devel pixman-devel
# 先复制package.json并安装依赖
COPY package*.json ./

RUN npm install -g cnpm && cnpm install

# 再复制其余文件
COPY . .

# 生成Prisma客户端
RUN cd src/model && prisma generate && npx prisma generate && cd -

EXPOSE 3000

RUN npm run build:linux && npm run build:linux:redis

CMD ["./uav-linux &", "./redis_key_expire_listener &"]